using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using UnityEngine;

namespace Voodoo.Sauce.Common.Font.Network
{
	public static class AsyncOperationExtension
	{
		public static TaskAwaiter GetAwaiter(this AsyncOperation asyncOp)
		{
			TaskCompletionSource<object> tcs = new TaskCompletionSource<object>();
			asyncOp.completed += delegate
			{
				tcs.SetResult(null);
			};
			return ((Task)tcs.Task).GetAwaiter();
		}
	}
}
